package net.feixiang.creational.prototype;

/**
 * 工作经历类
 * <p>
 * 该类用于存储工作经历信息，包括公司名称和工作年限。它可以被 Resume 类使用。
 * </p>
 *
 * @author 飞翔
 * @see <a href="https://www.feixiang.net/Java%E8%AE%BE%E8%AE%A1%E6%A8%A1%E5%BC%8F/%E7%AC%AC%E4%B8%80%E7%AB%A0%E3%80%81%E5%88%9B%E5%BB%BA%E5%9E%8B%E6%A8%A1%E5%BC%8F/14.html">建造者模式</a>
 */
public class WorkExperience {
    private String company; // 公司名称
    private int workYears; // 工作年限

    // 构造方法
    public WorkExperience(String company, int workYears) {
        this.company = company;
        this.workYears = workYears;
    }

    // getter 和 setter 方法
    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public int getWorkYears() {
        return workYears;
    }

    public void setWorkYears(int workYears) {
        this.workYears = workYears;
    }

    @Override
    public String toString() {
        return "WorkExperience{" +
                "company='" + company + '\'' +
                ", workYears=" + workYears +
                '}';
    }
}